<?php
error_reporting(0);

if (strtolower($_GET['turn']) == 'on') {
    setcookie('warn', 'true', time() + 60 * 60 * 24 * 365, '/');
    header('Location: ./');
} elseif (strtolower($_GET['turn']) == 'off') {
    setcookie('warn', '', time() - 3600, '/');
    header('Location: ./');
}

include '../includes/header-one.php';
?>
    
    <body>
        
<?php include '../includes/header-two.php'; ?>
        
        <p><form>
        <h2>URL Preview
<?php
include '../includes/config.php';
$APP_NAME = APP_NAME;

if (strtolower($_COOKIE['warn']) != 'true')
    {
		echo 'is <font color="#CC3300">NOT enabled.</font></h2>You will NOT be shown the full URL for links you click.<br/><br/><div class=buttons><a href="./?turn=on" class="positive-g" />Enable</a></div>';
	}else{
		echo 'is <font color="#00CA13">enabled.</font></h2>You will be shown the full URL for links you click.<br/><br/><div class=buttons><a href="./?turn=off" class="negative" />Disable</a></div>';
	}
	

?>
<br/><div class="description">Not everyone enjoys the surprise of clicking a link that could literally lead you <i>anywhere</i> on the internet. With <?php include '../includes/config.php'; echo APP_NAME; ?>'s preview functionality, you'll never have to worry about where that link is going!<br/>
<br/>By enabling preview, you are letting <?php include 'includes/config.php'; echo APP_NAME; ?> store a cookie to remember your preference. You will be given the full URL with the option to continue anytime you click on a <?php include '../includes/config.php'; echo APP_NAME; ?> link.</div><br/><br/>
        </form></p>

<?php include '../includes/footer.php'; ?>